<pre class="docs-method-signature"><code>path.divideAt(ratio [, opt])</code></pre>
<p>Divide the path into two paths at the point that lies <code>ratio</code> (normalized length) away from the beginning of the path.</p>

<p>Returns an array with two new paths without modifying the original path. The returned paths are valid; that is, they both start with an appropriate Moveto segment. Additionally, Closepath segments are converted into Lineto segments if necessary. The function expects <code>ratio</code> to lie between 0 and 1; values outside the range are constrained to 0 and 1, respectively. Invisible segments (e.g. Moveto segments) have no length and are therefore skipped by the algorithm. If the path contains no visible segments, <code>null</code> is returned.</p>

<p>The function uses the same algorithm as the <code>path.divideAtLength()</code> <a href="geometry.html#g.Path.prototype.divideAtLength">function</a>. It finds a visible segment which contains the point at length that corresponds to given <code>ratio</code> and then calls the segment's <code>divideAtLength()</code> function.</p>

<p>The <code>opt</code> argument is optional. Two properties may be specified, <code>opt.precision</code> and <code>opt.segmentSubdivisions</code>, which determine maximum error allowed in <code>divideAtLength</code> <a href="geometry.html#g.Curve.prototype.divideAtLength">calculations</a> for curved segments (default precision is 3; this corresponds to maximum observed error of 0.1%). The <code>opt.segmentSubdivisions</code> property is an array of individual segments' <a href="geometry.html#g.Curve.prototype.getSubdivisions">subdivision arrays</a>. The <code>path.getSegmentSubdivisions()</code> <a href="geometry.html#g.Path.prototype.getSegmentSubdivisions">function</a> may be used to obtain the <code>segmentSubdivisions</code> array. The <code>opt.precision</code> property is still necessary, however; it determines the precision of the point search algorithm in curved segments.</p>
